package game.dungeon;


import game.border.Border;
import game.border.WallWithDoor;
import game.square.Direction;
import game.square.Square;
import game.square.SquareInterface;

import org.junit.Before;
import org.junit.Test;

public class ShaftTest {

	@Before
	public void setUp() throws Exception {
		shaft = new Shaft<SquareInterface>(1,1,-1,50);
	}
	
	private Shaft<SquareInterface> shaft;

	@Test (expected=IllegalArgumentException.class)
	public final void testConstructor_illegalCase_1() {
		new Shaft<SquareInterface>(1,1,1,0);
	}
	
	@Test (expected=IllegalArgumentException.class)
	public final void testConstructor_illegalCase_2() {
		new Shaft<SquareInterface>(-500,-1,5,0);
	}
	
	@Test
	public final void testConstructor_legalCase_() {
		new Shaft<SquareInterface>(1,-500,1,0);
	}
	
	@Test
	public final void testAddSquare_legalCase1() {
		shaft.addSquare(new Square(), new Coordinates(1,1,10));
	}
	
	@Test
	public final void testAddSquare_legalCase2() {
		shaft.addSquare(new Square(new Border(Direction.CEILING, new WallWithDoor())), new Coordinates(1,1,50));
	}
	
	@Test (expected=IllegalArgumentException.class)
	public final void testAddSquare_illegalCase1() {
		shaft.addSquare(new Square(), new Coordinates(0,1,10));
	}
	
	@Test (expected=IllegalArgumentException.class)
	public final void testAddSquare_illegalCase2() {
		shaft.addSquare(new Square(), new Coordinates(1,0,10));
	}
	
	@Test (expected=IllegalArgumentException.class)
	public final void testAddSquare_illegalCase3() {
		shaft.addSquare(new Square(), new Coordinates(1,1,51));
	}
	
	@Test (expected=IllegalArgumentException.class)
	public final void testAddSquare_illegalCase4() {
		shaft.addSquare(new Square(), new Coordinates(0,0,10));
	}
	
	@Test (expected=IllegalArgumentException.class)
	public final void testAddSquare_illegalCase5() {
		shaft.addSquare(new Square(), new Coordinates(1,1,1));
	}
	
	@Test (expected=IllegalArgumentException.class)
	public final void testAddSquare_illegalCase6() {
		shaft.addSquare(new Square(), new Coordinates(1,1,10));
		shaft.addSquare(new Square(), new Coordinates(1,1,10));
	}
	
	
}
